﻿<!--
  // Deep Earth is a community project available under the Microsoft Public License (Ms-PL)
  // Code is provided as is and with no warranty - Use at your own risk
  // View the project and the latest code at http://DeepEarth.codeplex.com/
-->

<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ToolPanel="clr-namespace:DeepEarth.Client.Controls;assembly=DeepEarth.Client.Controls.ToolPanel">
    
	
	<!-- DataTemplate EndPath -->
    <DataTemplate x:Key="EndPath">
    	<Grid>
    		<Path Stretch="Fill" StrokeThickness="1" StrokeLineJoin="Miter" Stroke="#FF000000" Data="F1 M700.58099,321.34064 C734.69,354.68164 733.41199,418.2294 699.23602,456.89941 L722.51898,456.89941 C732.60602,457.06741 744.37299,455.55441 744.36603,442.09241 C744.71002,434.03641 744.67798,355.97162 744.71002,338.82364 C744.54199,323.69363 732.77399,321.16684 722.18298,321.16684 C714.17798,321.16684 713.60901,321.34064 700.58099,321.34064 z" Width="14.616" RenderTransformOrigin="0.5,0.5">
    			<Path.Fill>
    				<LinearGradientBrush  EndPoint="0.5,1" StartPoint="0.5,0">
    					<GradientStop Color="#FF242424"/>
    					<GradientStop Color="#FF313131" Offset="1"/>
    					<GradientStop Color="#FF080808" Offset="0.55800002813339233"/>
    				</LinearGradientBrush>
    			</Path.Fill>
    		</Path>
    	</Grid>
    </DataTemplate>

    <Style TargetType="ToolPanel:ToolPanel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToolPanel:ToolPanel">
                    <Canvas x:Name="LayoutRoot" Opacity="0.82" Width="260" Height="25">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.3000000"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal">
                                    <Storyboard/>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="OptionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.6000000"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Open">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="OptionsFlyout" Storyboard.TargetProperty="(FrameworkElement.Height)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="100"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="OptionsFlyout" Storyboard.TargetProperty="(Canvas.Top)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="-98"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Closed">
                                    <Storyboard/>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border Width="260" Height="25" HorizontalAlignment="Stretch" Background="#FF2B2B2B" BorderBrush="#FF000000" BorderThickness="1,1,1,1" Canvas.ZIndex="2">
                            <ContentPresenter Margin="20,0,20,0" 
                                    Width="210"
                                    Content="{TemplateBinding Content}"
                                    ContentTemplate="{TemplateBinding ContentTemplate}" />
                        </Border>

                        <ContentControl Content="{StaticResource EndPath}" Canvas.Left="0" Height="25" RenderTransformOrigin="0.5,0.5" ContentTemplate="{StaticResource EndPath}" Canvas.ZIndex="3">
                            <ContentControl.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1"/>
                                    <SkewTransform/>
                                    <RotateTransform Angle="180"/>
                                    <TranslateTransform/>
                                </TransformGroup>
                            </ContentControl.RenderTransform>
                        </ContentControl>

                        <ContentControl Content="{StaticResource EndPath}" Canvas.Left="245" Height="25" RenderTransformOrigin="0.5,0.5" ContentTemplate="{StaticResource EndPath}" Canvas.ZIndex="3">
                            <ContentControl.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1"/>
                                    <SkewTransform/>
                                    <RotateTransform Angle="0"/>
                                    <TranslateTransform/>
                                </TransformGroup>
                            </ContentControl.RenderTransform>
                        </ContentControl>
                        
                        <Grid Height="0" x:Name="OptionsFlyout" Width="240" Margin="10,0,10,25" Canvas.ZIndex="1">
                            <Border HorizontalAlignment="Stretch" Margin="5,0,5,0" Background="#FF2B2B2B" BorderBrush="#FF000000" BorderThickness="1,1,1,1" VerticalAlignment="Stretch">
                                <ContentPresenter Margin="8,8,8,8"
                                    Content="{TemplateBinding Options}"
                                    ContentTemplate="{TemplateBinding OptionsTemplate}" />
                            </Border>
                        </Grid>
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
	
</ResourceDictionary> 